package com.epam.util;

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class PropertiesReaderWithClassLoader {
	
	public static Map<String, String> getProperties(String propertiesName) throws IOException {
		Properties properties = new Properties();
		properties.load(new InputStreamReader(PropertyReader.class.getClassLoader()
				.getResourceAsStream(propertiesName)));

		Map<String, String> PropertyMap = new HashMap<String, String>();
		for (String key : properties.stringPropertyNames()) {
			PropertyMap.put(key, properties.getProperty(key));
		}
		return PropertyMap;
	}
}
